#include<stdio.h>
#include<stdlib.h>



int main()
{
	pid_t id = fork();
	if(id<0)
	{
		perror("fork");
		return 1;
	}
	else if(id>0)
	{
		printf("parent[%d] is about to quit...\n",getpid());
		sleep(5);
	}
	else
	{
		printf("child[%d] is about to become an orphan...\n",getpid());
		while(1)
		{
			printf("I'm orphan\n");
			sleep(1);
		}
	}

	return 0;
}
